import http from '/@/utils/http';

/**
 * 登录api接口集合
 * @method signIn 用户登录
 * @method signOut 用户退出登录
 * @method getMenuListByRole 获取用户菜单
 */

export const signIn = async (params: any) => {
  return await http.post('/user/mobile/userInfo/login', params)
}

// 退出登录
export const loginOut = async () => {
  return await http.deleteForm('/user/mobile/userInfo/logout')
}

// 设置主题色
export const setThemeColor = async (params: any) => {
  return await http.put('/user/mobile/userInfo/setThemeColor', params)
}

// 设置字号大小
export const setWordSize = async (params: any) => {
  return await http.put('/user/mobile/userInfo/setWordSize', params)
}

// 修改密码
export const updatePwd = async (params: any) => {
  return await http.put('/user/mobile/userInfo/updatePwd', params)
}

// 忘记密码
export const forgetPwd = async (params: any) => {
  return await http.put('/user/mobile/userInfo/forgetPwd', params)
}

// 发送短信验证码
export const sendSmsCode = async (params: any) => {
  return await http.post('/user/mobile/userInfo/sendSmsCode', params)
}

// 根据登录用户获取PC端菜单列表
export const getMenuListByRole = async () => {
  return await http.get('/user/mobile/sysMenuInfo/getMenuListByRole/1')
}

// 获取web第三方授权登陆配置信息
export const getWebThirdConfigApi = async (bindType: any) => {
  return await http.get(`/user/mobile/userInfo/getWebThirdConfig?bindType=${bindType}`)
}

// web第三方授权登陆
export const webThirdLoginApi = async (params: any) => {
  return await http.post(`/user/mobile/userInfo/webThirdLogin`, params)
}

// 验证短信验证码
export const verifySmsCodeApi = async (params: any) => {
  return await http.post(`/user/mobile/userInfo/verifySmsCode`, params)
}

// 申请试用账号
export const applyTrialApi = async (params: any) => {
  return await http.post(`/user/mobile/companyInfo/applyTrial`, params)
}

// 绑定用户并登录
export const bindUserApi = async (params: any) => {
  return await http.post(`/user/mobile/userInfo/bindUser`, params)
}


